import { defineConfig } from 'vitepress'

// import { demoblockPlugin, demoblockVitePlugin } from 'vitepress-theme-demoblock'
// import vueJsx from '@vitejs/plugin-vue-jsx'

import { mdPlugin } from './config/plugins'

export default defineConfig({
  title: 'svmp',
  description: '基于Element-plus基础组件封装使用',
  lang: 'cn-ZH',
  base: '/',
  lastUpdated: true,
  themeConfig: {
    logo: '/p.png',
    siteTitle: '基础文档',
    outline: 3,
    socialLinks: [{ icon: 'github', link: '/' }],

    nav: [
      {
        text: '基础文档',
        link: '/docs/',
      },
      {
        text: '基础组件',
        link: '/components/',
      },
    ],
    sidebar: {
      '/components': [
        {
          text: '常用组件',
          items: [
            { text: '下拉表格组件', link: '/components/combogrid/combogrid.md' },
            { text: '分区拖拽', link: '/components/splitpane/splitpane.md' },
            // { text: 'Button组件', link: '/components/TButton/base.md' },
          ],
        },
        {
          text: '复杂组件',
          items: [
            {
              text: '动态表单',
              link: '/components/vform/vform.md',
            },
            {
              text: '动态表格组件',
              link: '/components/Table/base.md',
            },
            {
              text: '弹框',
              link: '/components/vwindow/vwindow.md',
            },
          ],
        },
      ],
      '/docs/': [
        { text: '基础文档', link: '/docs/index.md' },
        { text: 'lodop 设计模式', link: '/docs/lodopdesign.md' },
      ],
    },
  },
  markdown: {
    headers: {
      level: [0, 0],
    },
    // light: #f9fafb, dark: --vp-code-block-bg
    theme: { light: 'github-light', dark: 'github-dark' },
    config: (md) => mdPlugin(md),
  },

  // markdown: {
  //   theme: { light: 'github-light', dark: 'github-dark' },

  //   config: (md) => {
  //     md.use(demoblockPlugin, {
  //       customClass: 'demoblock-custom',
  //     })
  //   },
  // },

  vite: {
    // plugins: [demoblockVitePlugin(), vueJsx()],
    // resolve: {
    //   alias: {
    //     '@alias': path.resolve(__dirname, '../'),
    //   },
    // },
  },
})
